<?php
namespace app\superAdmin\controller;
use \think\Controller;
use \think\Db;


class Device extends Controller 
{
	public function index()
    {
    	$devices = Db::name('screen_ck')->select();
    	$this->assign("deviceList",$devices);
        return $this->fetch();;
    }
    public function find(){
    	$findid=input('findid');
		$findstate=input('findstate');
		$findtype=input('findtype');

    	if ($findid!=NULL) {
    		$registration=Db::query("select * from `screen_ck` where sid='$findid'");
		    $this->assign("deviceList",$registration);
		    return $this->fetch("index");
    	}elseif ($findstate!=NULL) {
    		$registration=Db::query("select * from `screen_ck` where sstate='$findstate'");
		    $this->assign("deviceList",$registration);
		    return $this->fetch("index");
    	}elseif ($findtype!=NULL) {
    		$registration=Db::query("select * from `screen_ck` where stype='$findtype'");
		    $this->assign("deviceList",$registration);
		    return $this->fetch("index");
    	}else{
    		$registration=Db::query("select * from `screen_ck`");
		    $this->assign("deviceList",$registration);
		    return $this->fetch("index");
    	}
    }

}